package cn.iocoder.yudao.module.distm.dal.mysql.quarterplan;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.distm.dal.dataobject.quarterplan.QuarterPlanDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.distm.controller.admin.quarterplan.vo.*;

/**
 * 配送管理-季度计划 Mapper
 *
 * @author yisl
 */
@Mapper
public interface QuarterPlanMapper extends BaseMapperX<QuarterPlanDO> {

    default PageResult<QuarterPlanDO> selectPage(QuarterPlanPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<QuarterPlanDO>()
                .likeIfPresent(QuarterPlanDO::getMealUnit, reqVO.getMealUnit())
                .eqIfPresent(QuarterPlanDO::getFlightNo, reqVO.getFlightNo())
                .eqIfPresent(QuarterPlanDO::getAircraftType, reqVO.getAircraftType())
                .eqIfPresent(QuarterPlanDO::getDepLoc, reqVO.getDepLoc())
                .eqIfPresent(QuarterPlanDO::getArrLoc, reqVO.getArrLoc())
                .betweenIfPresent(QuarterPlanDO::getArrTime, reqVO.getArrTime())
                .eqIfPresent(QuarterPlanDO::getCrewMeal, reqVO.getCrewMeal())
                .orderByDesc(QuarterPlanDO::getId));
    }

}